import re
from . import mysql

def get_id(url):
    return re.findall(r"id=(\d*)", url)[0]

def get_download(id, new = None):
    mp3 = {
        "url":'http://music.163.com/song/media/outer/url?id=' + id + '.mp3',
        "id":id,
    }
    return mp3

def url_download(url):
    id = get_id(url)
    return get_download(id, 'true')
